package com.data.modules.wrt.job;

import com.data.modules.smzh.service.ISmThirdRegistService;
import com.data.modules.wrt.service.IWrtAiLogService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 统计ai预警房间号 超过24、48 小时 未有刷卡记录
 */
@SuppressWarnings("ALL")
@Slf4j
public class SynAiJob implements Job {


	@Autowired
	private IWrtAiLogService aiLogService;
	/**
	 * 若参数变量名修改 QuartzJobController中也需对应修改
	 */
	private String parameter;

	public void setParameter(String parameter) {
		this.parameter = parameter;
	}

	@Override
	public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

		long start = System.currentTimeMillis();
		log.info("SynAiJob===开始{}",start);
		try {
			aiLogService.synAiInfo();
		} catch (Exception e) {
			log.error("SynAiJob==定时任务异常",e.getMessage(),e);
		}
		log.info("SynAiJob===结束耗时{}秒",(System.currentTimeMillis()-start)/1000);

	}

}
